package _11define._02test;

public class Test2 {
    public static void main(String[] args) {
        SouthPerson southPerson=new SouthPerson();
        southPerson.eat();
        NorthPerson northPerson=new NorthPerson();
        northPerson.eat();
    }
}
class Person{
    String name;
    int age;
    public void eat(){
        System.out.println("人都要吃饭");
    }
}
class SouthPerson extends Person{
    double salary;
    public void eat(){
        System.out.println("南方人喜欢吃米饭");
    }
    public void swim(){
        System.out.println("南方人喜欢游泳");
    }
}
class NorthPerson extends Person{
    double height;
    public void eat(){
        System.out.println("北方人喜欢吃米饭");
    }
    public void drink(){
        System.out.println("北方人喜欢喝饮料");
    }
}
